<?php
/**
 * Created by PhpStorm.
 * User: sofwu
 * Date: 2019/1/14
 * Time: 下午3:22
 */
namespace App\Http\Transformer;

use App\Http\Model\Ad;
use App\Model\User;
use League\Fractal\TransformerAbstract;

class UserTransformer extends TransformerAbstract
{
    public function transform(User $user)
    {
        return[
            'id'=> $user->id,
            'nickname'=> $user->nickname,
            'sex'=> $user->sex,
            'head_pic'=> $user->head_pic,
        ];
    }
}